-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iobuffer: copyline: type assert Int
to prevent invalidation
#57848
Merged
vtjnash
merged 1 commit into
JuliaLang:master
from
nsajko:invalidations_type_stability_IOBuffer_copyline_type_assert_Int
Mar 21, 2025
Merged
iobuffer: copyline: type assert Int
to prevent invalidation
#57848
vtjnash
merged 1 commit into
JuliaLang:master
from
nsajko:invalidations_type_stability_IOBuffer_copyline_type_assert_Int
Mar 21, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Should prevent much invalidation stemming from `MethodInstance`s for * `readline()` * `readlines()` * `Base.run_fallback_repl(::Bool)` * `Base.repl_main(::Any)` * `Base._start()` In each case the issue is the access of the nonconcretely-typed global variable `stdin::IO`.
These invalidations on loading the package TypeDomainNaturalNumber v7.0.0 are fixed by the change: {
"method_instance": {
"method": "var\"#_copyline#393\"(keep::Bool, ::typeof(Base._copyline), out::IO, io::Base.GenericIOBuffer) @ Base iobuffer.jl:642",
"method_instance": "MethodInstance for Base.var\"#_copyline#393\"(::Bool, ::typeof(Base._copyline), ::IOBuffer, ::Base.GenericIOBuffer)"
},
"children": [
{
"method_instance": {
"method": "kwcall(::NamedTuple, ::typeof(Base._copyline), out::IO, io::Base.GenericIOBuffer) @ Base iobuffer.jl:642",
"method_instance": "MethodInstance for Core.kwcall(::@NamedTuple{keep::Bool}, ::typeof(Base._copyline), ::IOBuffer, ::Base.GenericIOBuffer)"
},
"children": [
{
"method_instance": {
"method": "var\"#copyline#395\"(keep::Bool, ::typeof(copyline), out::Base.GenericIOBuffer, io::Base.GenericIOBuffer) @ Base iobuffer.jl:656",
"method_instance": "MethodInstance for Base.var\"#copyline#395\"(::Bool, ::typeof(copyline), ::IOBuffer, ::Base.GenericIOBuffer)"
},
"children": [
{
"method_instance": {
"method": "kwcall(::NamedTuple, ::typeof(copyline), out::Base.GenericIOBuffer, io::Base.GenericIOBuffer) @ Base iobuffer.jl:656",
"method_instance": "MethodInstance for Core.kwcall(::@NamedTuple{keep::Bool}, ::typeof(copyline), ::IOBuffer, ::Base.GenericIOBuffer)"
},
"children": [
{
"method_instance": {
"method": "var\"#readline#353\"(keep::Bool, ::typeof(readline), s::IO) @ Base io.jl:619",
"method_instance": "MethodInstance for Base.var\"#readline#353\"(::Bool, ::typeof(readline), ::IO)"
},
"children": [
{
"method_instance": {
"method": "kwcall(::NamedTuple, ::typeof(readline), s::IO) @ Base io.jl:619",
"method_instance": "MethodInstance for Core.kwcall(::@NamedTuple{keep::Bool}, ::typeof(readline), ::IO)"
},
"children": [
{
"method_instance": {
"method": "iterate(itr::Base.EachLine, state) @ Base io.jl:1234",
"method_instance": "MethodInstance for iterate(::Base.EachLine, ::Nothing)"
},
"children": [
{
"method_instance": {
"method": "_collect(cont, itr, ::Base.HasEltype, isz::Base.SizeUnknown) @ Base array.jl:737",
"method_instance": "MethodInstance for Base._collect(::UnitRange{Int64}, ::Base.EachLine, ::Base.HasEltype, ::Base.SizeUnknown)"
},
"children": [
]
},
{
"method_instance": {
"method": "iterate(itr::Base.EachLine) @ Base io.jl:1234",
"method_instance": "MethodInstance for iterate(::Base.EachLine)"
},
"children": [
{
"method_instance": {
"method": "_collect(cont, itr, ::Base.HasEltype, isz::Base.SizeUnknown) @ Base array.jl:737",
"method_instance": "MethodInstance for Base._collect(::UnitRange{Int64}, ::Base.EachLine, ::Base.HasEltype, ::Base.SizeUnknown)"
},
"children": [
{
"method_instance": {
"method": "collect(itr) @ Base array.jl:728",
"method_instance": "MethodInstance for collect(::Base.EachLine)"
},
"children": [
{
"method_instance": {
"method": "var\"#readlines#363\"(kw::Base.Pairs{Symbol, V, NTuple{N, Symbol}, NamedTuple{names, T}} where {V, N, names, T<:NTuple{N, Any}}, ::typeof(readlines), s) @ Base io.jl:708",
"method_instance": "MethodInstance for Base.var\"#readlines#363\"(::Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, ::typeof(readlines), ::IO)"
},
"children": [
{
"method_instance": {
"method": "readlines(s; kw...) @ Base io.jl:708",
"method_instance": "MethodInstance for readlines(::IO)"
},
"children": [
{
"method_instance": {
"method": "readlines(; ...) @ Base io.jl:708",
"method_instance": "MethodInstance for readlines()"
},
"children": [
]
}
]
}
]
}
]
}
]
}
]
}
]
},
{
"method_instance": {
"method": "run_fallback_repl(interactive::Bool) @ Base client.jl:426",
"method_instance": "MethodInstance for Base.run_fallback_repl(::Bool)"
},
"children": [
]
},
{
"method_instance": {
"method": "run_fallback_repl(interactive::Bool) @ Base client.jl:426",
"method_instance": "MethodInstance for Base.run_fallback_repl(::Bool)"
},
"children": [
]
},
{
"method_instance": {
"method": "run_fallback_repl(interactive::Bool) @ Base client.jl:426",
"method_instance": "MethodInstance for Base.run_fallback_repl(::Bool)"
},
"children": [
]
},
{
"method_instance": {
"method": "run_fallback_repl(interactive::Bool) @ Base client.jl:426",
"method_instance": "MethodInstance for Base.run_fallback_repl(::Bool)"
},
"children": [
{
"method_instance": {
"method": "run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_file::Bool) @ Base client.jl:498",
"method_instance": "MethodInstance for Base.run_main_repl(::Bool, ::Bool, ::Symbol, ::Bool)"
},
"children": [
{
"method_instance": {
"method": "repl_main(::Any) @ Base client.jl:585",
"method_instance": "MethodInstance for Base.repl_main(::Vector{String})"
},
"children": [
{
"method_instance": {
"method": "_start() @ Base client.jl:553",
"method_instance": "MethodInstance for Base._start()"
},
"children": [
]
}
]
}
]
}
]
}
]
},
{
"method_instance": {
"method": "readline(s::IO; keep) @ Base io.jl:619",
"method_instance": "MethodInstance for readline(::IO)"
},
"children": [
{
"method_instance": {
"method": "readline(; ...) @ Base io.jl:619",
"method_instance": "MethodInstance for readline()"
},
"children": [
]
}
]
}
]
}
]
}
]
}
]
}
]
} |
vtjnash
approved these changes
Mar 21, 2025
KristofferC
pushed a commit
that referenced
this pull request
Mar 22, 2025
Should prevent invalidation stemming from `MethodInstance`s for * `readline()` * `readlines()` * `Base.run_fallback_repl(::Bool)` * `Base.repl_main(::Any)` * `Base._start()` In each case the issue is the use of the nonconcretely-typed global variable `stdin::IO`. (cherry picked from commit eed18bd)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport 1.11
Change should be backported to release-1.11
backport 1.12
Change should be backported to release-1.12
invalidations
io
Involving the I/O subsystem: libuv, read, write, etc.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Should prevent invalidation stemming from
MethodInstance
s forreadline()
readlines()
Base.run_fallback_repl(::Bool)
Base.repl_main(::Any)
Base._start()
In each case the issue is the use of the nonconcretely-typed global variable
stdin::IO
.